package com.aiyige.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by zhuyakun on 2017/12/19.
 */

public class TagDepricated implements Parcelable {
    String id;
    String name;
    String groupType;
    Integer exclusive;
    String creator;
    String categoryId;
    long createTime;
    long updateTime;

    private TagDepricated(Builder builder) {
        setId(builder.id);
        setName(builder.name);
        setGroupType(builder.groupType);
        setExclusive(builder.exclusive);
        setCreator(builder.creator);
        setCategoryId(builder.categoryId);
        setCreateTime(builder.createTime);
        setUpdateTime(builder.updateTime);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGroupType() {
        return groupType;
    }

    public void setGroupType(String groupType) {
        this.groupType = groupType;
    }

    public Integer getExclusive() {
        return exclusive;
    }

    public void setExclusive(Integer exclusive) {
        this.exclusive = exclusive;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public static final class Builder {
        private String id;
        private String name;
        private String groupType;
        private Integer exclusive;
        private String creator;
        private String categoryId;
        private long createTime;
        private long updateTime;

        private Builder() {
        }

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder groupType(String groupType) {
            this.groupType = groupType;
            return this;
        }

        public Builder exclusive(Integer exclusive) {
            this.exclusive = exclusive;
            return this;
        }

        public Builder creator(String creator) {
            this.creator = creator;
            return this;
        }

        public Builder categoryId(String categoryId) {
            this.categoryId = categoryId;
            return this;
        }

        public Builder createTime(long createTime) {
            this.createTime = createTime;
            return this;
        }

        public Builder updateTime(long updateTime) {
            this.updateTime = updateTime;
            return this;
        }

        public TagDepricated build() {
            return new TagDepricated(this);
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.name);
        dest.writeString(this.groupType);
        dest.writeValue(this.exclusive);
        dest.writeString(this.creator);
        dest.writeString(this.categoryId);
        dest.writeLong(this.createTime);
        dest.writeLong(this.updateTime);
    }

    protected TagDepricated(Parcel in) {
        this.id = in.readString();
        this.name = in.readString();
        this.groupType = in.readString();
        this.exclusive = (Integer) in.readValue(Integer.class.getClassLoader());
        this.creator = in.readString();
        this.categoryId = in.readString();
        this.createTime = in.readLong();
        this.updateTime = in.readLong();
    }

    public static final Parcelable.Creator<TagDepricated> CREATOR = new Parcelable.Creator<TagDepricated>() {
        @Override
        public TagDepricated createFromParcel(Parcel source) {
            return new TagDepricated(source);
        }

        @Override
        public TagDepricated[] newArray(int size) {
            return new TagDepricated[size];
        }
    };
}
